package com.xiaozhengkeji.springcloud.ezcloud.common.core.utils;

import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.MD5;
import cn.hutool.crypto.digest.SM3;
import lombok.extern.slf4j.Slf4j;

/**
 * 用户部分 静态工具集
 */
@Slf4j
public class UserUtils {
    private final static byte[] EncryptKey = "EZCloud".getBytes();

    /**
     * 用户密码Hash
     */
    public static String userPasswordHash(String password) {
        //log.info("不加盐: -> {}", new MD5().digestHex16(password));
        //log.info("加盐: -> {}", new MD5(EncryptKey).digestHex16(password));
        return new MD5(EncryptKey).digestHex16(password);
    }
}
